package com.xcy.service.Impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcy.dao.IUserDao;
import com.xcy.dto.User;
import com.xcy.service.IUserService;

@Service("userService")
public class UserServiceImpl implements IUserService {
    @Resource
    private IUserDao userDao;

    public User getUserById(int userId) {
        return userDao.queryByPrimaryKey(userId);
    }

    public void insertUser(User user) {
        userDao.insertUser(user);
    }

    public void addUser(User user) {
        userDao.insertUser(user);
    }

    public List<User> getAllUser() {
        return userDao.getAllUser();
    }

    public void deleteUserById(int id) { userDao.deleteByPrimaryKey(id);}

    public void updateUser(User user) { userDao.updateByPrimaryKey(user);}
}